﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ncp.Business;
using System.Data;
using System.Text;
using System.Configuration;
using ncp.Business.Common;

namespace ncp.Web.cms
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var userInfo = WebMasterCookie.GetCookie(CommonConst.adminCookieName);
                if (userInfo == null)
                {
                    Response.Redirect("/cms/login.aspx");
                }
                else
                {
                    userInfo.Computerip = Request.UserHostAddress;
                    userInfo.Computername = CommonBll.GetClientOS(Request.UserAgent) + " " + Request.Browser.Browser + " " + Request.Browser.MajorVersion;
                    WebMasterCookie.UpdateCookie(userInfo, CommonConst.adminCookieName);
                }
            }
        }
    }
}
